using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class PausePanel : BasePanel
{
    private Button backButton;
    private Button continueButton;

    public override void OnInit()
    {
        skinPath = "PausePanel";
        layer = PanelManager.Layer.Tip;
    }

    public override void OnShow()
    {
        backButton = skin.transform.Find("BackButton").GetComponent<Button>();
        continueButton = skin.transform.Find("ContinueButton").GetComponent<Button>();

        backButton.onClick.AddListener(OnBackClick);
        continueButton.onClick.AddListener(OnContinueClick);
    }

    public override void OnClose() { }

    private void OnBackClick()
    {
        SceneManager.LoadScene(1);
        PanelManager.Close("PlayPanel");
        Close();
    }

    private void OnContinueClick()
    {
        Time.timeScale = 1;
        Close();
    }
}
